﻿namespace Pottery.Module.Infrastructure.Models
{
    using System;
    using System.Data.SqlTypes;
    using System.Runtime.Serialization;
    using System.Text.RegularExpressions;
    using Pottery.Model.Infrastructure;

    /// <summary>
    /// Describes common properties for user and employee
    /// </summary>
    [DataContract]
    public class Human
    {
        #region Constructors

        /// <summary>
        /// Initializes new default Human
        /// </summary>
        protected Human() { }

        /// <summary>
        /// Initializes new instance of Human
        /// </summary>
        /// <param name="login">Human's login</param>
        /// <param name="password">Human's password</param>
        /// <param name="firstName">Human's name</param>
        /// <param name="lastName">Human's surnam</param>
        /// <param name="email">Human's email</param>
        /// <param name="address">Human's address</param>
        /// <param name="phone">Human's phone</param>
        /// <param name="photo">Human's photo</param>
        protected Human(string login, string password, string firstName, string lastName,
                    string email, string address, string phone, byte[] photo)
        {
            Login = login;
            Password = password;
            FirstName = firstName;
            LastName = lastName;
            Email = email;
            Address = address;
            Phone = phone;
            Photo = photo;
            RegistrationDate = DateTime.Now;
        }

        #endregion

        #region Properties

        [DataMember(Order = 1)]
        public string Login
        {
            get
            {
                return m_Login;
            }
            set
            {
                m_Login = value;
            }
        }

        [DataMember(Order = 3)]
        public string FirstName
        {
            get
            {
                return m_FirstName;
            }
            set
            {
                m_FirstName = value;
            }
        }

        [DataMember(Order = 4)]
        public string LastName
        {
            get
            {
                return m_LastName;
            }
            set
            {
                m_LastName = value;
            }
        }

        [DataMember(Order = 2)]
        public string Password
        {
            get
            {
                return m_Password;
            }
            set
            {
                m_Password = value;
            }
        }

        [DataMember(Order = 5)]
        public string Email
        {
            get
            {
                return m_Email;
            }
            set
            {
                m_Email = value;
            }
        }

        [DataMember(Order = 6)]
        public string Phone
        {
            get
            {
                return m_Phone;
            }
            set
            {
                m_Phone = value;
            }
        }

        [DataMember(Order = 7)]
        public string Address
        {
            get
            {
                return m_Address;
            }
            set
            {
                m_Address = value;
            }
        }

        [DataMember(Order = 8)]
        public byte[] Photo
        {
            get
            {
                return m_Photo;
            }
            set
            {
                m_Photo = value;
            }
        }


        [DataMember(Order = 9)]
        public DateTime RegistrationDate
        {
            get
            {
                return m_RegistrationDate;
            }
            set
            {
                m_RegistrationDate = value;
            }
        }        

        #endregion

        #region Fields

        private string m_Login = default(string);
        private string m_Password = default(string);
        private string m_FirstName = default(string);
        private string m_LastName = default(string);
        private string m_Email = default(string);
        private string m_Address = default(string);
        private string m_Phone = default(string);
        private byte[] m_Photo = default(byte[]);
        private DateTime m_RegistrationDate = default(DateTime);        

        #endregion
    }
}
